﻿using GuoZhiQi.MiddleCache.Common.Serialization;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GuoZhiQi.MiddleCache
{
    /// <summary>
    /// 包括key和CAS标识
    /// </summary>
    [Serializable]
    public abstract class CouchBaseObjectLight : JsonObjectBase
    {
        /// <summary>
        /// couchBase key for this object
        /// </summary>
        [JsonIgnore]
        public abstract string Key { get; set; }


        /// <summary>
        /// CAS  的值用来指定当前对象的版本  versioning
        /// </summary>
        [JsonIgnore]
        public ulong CAS { get; set; }


        public CouchBaseObjectLight()
        {
            this._jsonInSync = false;
        }

        public CouchBaseObjectLight(string objectKey)
        {
            this._jsonInSync = false;
            this.Key = objectKey;
            if (this.Key == null)
            {
                throw new ArgumentNullException("objectKey is Null");
            }
        }
    }
}
